package com.restaurant.application.indexes.reservationlist.mysql;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;

import java.util.List;

public class ReservationListBean implements PickableBean {

    public static final String FN_RECORDID = "recordId";
    public static final String FN_RESERVATIONUID = "reservationUid";
    public static final String FN_ID = "id";
    public static final String FN_CREATETIME = "createTime";
    public static final String FN_MODIFYTIME = "modifyTime";
    public static final String FN_NUMBER = "number";
    public static final String FN_SHOPUID = "shopUid";
    public static final String FN_SHOPNAME = "shopName";
    public static final String FN_SERVICENAME = "serviceName";
    public static final String FN_PERSONAMOUNT = "personAmount";
    public static final String FN_DATE = "date";
    public static final String FN_TIME = "time";
    public static final String FN_CUSTOMERID = "customerId";
    public static final String FN_CUSTOMERUID = "customerUid";
    public static final String FN_CUSTOMERNAME = "customerName";
    public static final String FN_PHONE = "phone";
    public static final String FN_REMARKS = "remarks";
    public static final String FN_STATE = "state";

    public static final List<String> FIELD_NAMES = Lists.newArrayList(
             FN_RECORDID,
             FN_RESERVATIONUID,
             FN_ID,
             FN_CREATETIME,
             FN_MODIFYTIME,
             FN_NUMBER,
             FN_SHOPUID,
             FN_SHOPNAME,
            FN_SERVICENAME,
             FN_PERSONAMOUNT,
            FN_DATE,
            FN_TIME,
             FN_CUSTOMERID,
             FN_CUSTOMERUID,
             FN_CUSTOMERNAME,
             FN_PHONE,
             FN_REMARKS,
             FN_STATE);

    private Long recordId;
    private UID reservationUid;
    private String id;
    private Long createTime;
    private Long modifyTime;
    private String number;
    private String shopUid;
    private String shopName;
    private String serviceName;
    private String personAmount;
    private Long date;
    private String time;
    private String customerId;
    private String customerUid;
    private String customerName;
    private String phone;
    private String remarks;
    private String state;

    public ReservationListBean(Long recordId, UID reservationUid, String id, Long createTime, Long modifyTime, String number, String shopUid, String shopName, String serviceName, String personAmount, Long date, String time, String customerId, String customerUid, String customerName, String phone, String remarks, String state) {
        setRecordId(recordId);
        setReservationUid(reservationUid);
        setId(id);
        setCreateTime(createTime);
        setModifyTime(modifyTime);
        setNumber(number);
        setShopUid(shopUid);
        setShopName(shopName);
        setServiceName(serviceName);
        setPersonAmount(personAmount);
        setDate(date);
        setTime(time);
        setCustomerId(customerId);
        setCustomerUid(customerUid);
        setCustomerName(customerName);
        setPhone(phone);
        setRemarks(remarks);
        setState(state);
    }

    public ReservationListBean() {
    }

    public ReservationListBean duplicate() {
        ReservationListBean result = new ReservationListBean();
        result.recordId = this.recordId;
        result.reservationUid = this.reservationUid;
        result.id = this.id;
        result.createTime = this.createTime;
        result.modifyTime = this.modifyTime;
        result.number = this.number;
        result.shopUid = this.shopUid;
        result.shopName = this.shopName;
        result.serviceName = this.serviceName;
        result.personAmount = this.personAmount;
        result.date = this.date;
        result.time = this.time;
        result.customerId = this.customerId;
        result.customerUid = this.customerUid;
        result.customerName = this.customerName;
        result.phone = this.phone;
        result.remarks = this.remarks;
        result.state = this.state;
        return result;
    }

    @Override
    public String toString() {
        return Convert.toJson(this);
    }

    public Long getRecordId() {
        return recordId;
    }

    public void  setRecordId(Long value) {
        this.recordId = value;
    }

    public ReservationListBean withRecordId(Long value) {
        setRecordId(value);
        return this;
    }

    public ReservationListBean withRecordId(Long value, Long defaultValue) {
        setRecordId(value == null ? defaultValue : value);
        return this;
    }

    public UID getReservationUid() {
        return reservationUid;
    }

    public void  setReservationUid(UID value) {
        this.reservationUid = value;
    }

    public ReservationListBean withReservationUid(UID value) {
        setReservationUid(value);
        return this;
    }

    public ReservationListBean withReservationUid(UID value, UID defaultValue) {
        setReservationUid(value == null ? defaultValue : value);
        return this;
    }

    public String getId() {
        return id;
    }

    public void  setId(String value) {
        this.id = value;
    }

    public ReservationListBean withId(String value) {
        setId(value);
        return this;
    }

    public ReservationListBean withId(String value, String defaultValue) {
        setId(value == null ? defaultValue : value);
        return this;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void  setCreateTime(Long value) {
        this.createTime = value;
    }

    public ReservationListBean withCreateTime(Long value) {
        setCreateTime(value);
        return this;
    }

    public ReservationListBean withCreateTime(Long value, Long defaultValue) {
        setCreateTime(value == null ? defaultValue : value);
        return this;
    }

    public Long getModifyTime() {
        return modifyTime;
    }

    public void  setModifyTime(Long value) {
        this.modifyTime = value;
    }

    public ReservationListBean withModifyTime(Long value) {
        setModifyTime(value);
        return this;
    }

    public ReservationListBean withModifyTime(Long value, Long defaultValue) {
        setModifyTime(value == null ? defaultValue : value);
        return this;
    }

    public String getNumber() {
        return number;
    }

    public void  setNumber(String value) {
        this.number = value;
    }

    public ReservationListBean withNumber(String value) {
        setNumber(value);
        return this;
    }

    public ReservationListBean withNumber(String value, String defaultValue) {
        setNumber(value == null ? defaultValue : value);
        return this;
    }

    public String getShopUid() {
        return shopUid;
    }

    public void  setShopUid(String value) {
        this.shopUid = value;
    }

    public ReservationListBean withShopUid(String value) {
        setShopUid(value);
        return this;
    }

    public ReservationListBean withShopUid(String value, String defaultValue) {
        setShopUid(value == null ? defaultValue : value);
        return this;
    }

    public String getShopName() {
        return shopName;
    }

    public void  setShopName(String value) {
        this.shopName = value;
    }

    public ReservationListBean withShopName(String value) {
        setShopName(value);
        return this;
    }

    public ReservationListBean withShopName(String value, String defaultValue) {
        setShopName(value == null ? defaultValue : value);
        return this;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String value) {
        this.serviceName = value;
    }

    public ReservationListBean withServiceName(String value) {
        setServiceName(value);
        return this;
    }

    public ReservationListBean withServiceName(String value, String defaultValue) {
        setServiceName(value == null ? defaultValue : value);
        return this;
    }

    public String getPersonAmount() {
        return personAmount;
    }

    public void  setPersonAmount(String value) {
        this.personAmount = value;
    }

    public ReservationListBean withPersonAmount(String value) {
        setPersonAmount(value);
        return this;
    }

    public ReservationListBean withPersonAmount(String value, String defaultValue) {
        setPersonAmount(value == null ? defaultValue : value);
        return this;
    }

    public Long getDate() {
        return date;
    }

    public void setDate(Long value) {
        this.date = value;
    }

    public ReservationListBean withDate(Long value) {
        setDate(value);
        return this;
    }

    public ReservationListBean withDate(Long value, Long defaultValue) {
        setDate(value == null ? defaultValue : value);
        return this;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String value) {
        this.time = value;
    }

    public ReservationListBean withTime(String value) {
        setTime(value);
        return this;
    }

    public ReservationListBean withTime(String value, String defaultValue) {
        setTime(value == null ? defaultValue : value);
        return this;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void  setCustomerId(String value) {
        this.customerId = value;
    }

    public ReservationListBean withCustomerId(String value) {
        setCustomerId(value);
        return this;
    }

    public ReservationListBean withCustomerId(String value, String defaultValue) {
        setCustomerId(value == null ? defaultValue : value);
        return this;
    }

    public String getCustomerUid() {
        return customerUid;
    }

    public void  setCustomerUid(String value) {
        this.customerUid = value;
    }

    public ReservationListBean withCustomerUid(String value) {
        setCustomerUid(value);
        return this;
    }

    public ReservationListBean withCustomerUid(String value, String defaultValue) {
        setCustomerUid(value == null ? defaultValue : value);
        return this;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void  setCustomerName(String value) {
        this.customerName = value;
    }

    public ReservationListBean withCustomerName(String value) {
        setCustomerName(value);
        return this;
    }

    public ReservationListBean withCustomerName(String value, String defaultValue) {
        setCustomerName(value == null ? defaultValue : value);
        return this;
    }

    public String getPhone() {
        return phone;
    }

    public void  setPhone(String value) {
        this.phone = value;
    }

    public ReservationListBean withPhone(String value) {
        setPhone(value);
        return this;
    }

    public ReservationListBean withPhone(String value, String defaultValue) {
        setPhone(value == null ? defaultValue : value);
        return this;
    }

    public String getRemarks() {
        return remarks;
    }

    public void  setRemarks(String value) {
        this.remarks = value;
    }

    public ReservationListBean withRemarks(String value) {
        setRemarks(value);
        return this;
    }

    public ReservationListBean withRemarks(String value, String defaultValue) {
        setRemarks(value == null ? defaultValue : value);
        return this;
    }

    public String getState() {
        return state;
    }

    public void  setState(String value) {
        this.state = value;
    }

    public ReservationListBean withState(String value) {
        setState(value);
        return this;
    }

    public ReservationListBean withState(String value, String defaultValue) {
        setState(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        switch(name) {
        case "recordId": return getRecordId();
        case "reservationUid": return getReservationUid();
        case "id": return getId();
        case "createTime": return getCreateTime();
        case "modifyTime": return getModifyTime();
        case "number": return getNumber();
        case "shopUid": return getShopUid();
        case "shopName": return getShopName();
            case "serviceName":
                return getServiceName();
        case "personAmount": return getPersonAmount();
            case "date":
                return getDate();
            case "time":
                return getTime();
        case "customerId": return getCustomerId();
        case "customerUid": return getCustomerUid();
        case "customerName": return getCustomerName();
        case "phone": return getPhone();
        case "remarks": return getRemarks();
        case "state": return getState();
        }
        return null;
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    @Override
    public int hashCode() {
        return signature().hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if(!(o instanceof ReservationListBean)) return false;
        return signature().equals(((ReservationListBean)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean ReservationListBean has no signature defined, no hash code or equals possible.");
    }
}
